package com.modules.asset.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;

/**
 * CREATE TABLE `user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户唯一标识',
  `username` varchar(50) NOT NULL COMMENT '用户名，用于登录',
  `password` varchar(100) NOT NULL COMMENT '加密后的密码',
  `email` varchar(100) DEFAULT NULL COMMENT '邮箱，用于找回密码等',
  `phone` varchar(20) DEFAULT NULL COMMENT '手机号',
  `nickname` varchar(50) DEFAULT NULL COMMENT '用户昵称',
  `avatar` varchar(255) DEFAULT NULL COMMENT '头像图片URL',
  `gender` tinyint(1) DEFAULT NULL COMMENT '性别：0-未知，1-男，2-女',
  `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态：0-禁用，1-正常',
  `last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_username` (`username`),
  UNIQUE KEY `idx_email` (`email`),
  KEY `idx_phone` (`phone`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
 * 生成时间：2025-10-27 16:44:22
 */
@Data
@TableName(value = "user")
public class User implements Serializable {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "用户唯一标识")
    private Long id;
    @Schema(description = "用户名,用于登录")
    private String username;
    @Schema(description = "加密后的密码")
    private String password;
    @Schema(description = "邮箱,用于找回密码等")
    private String email;
    @Schema(description = "手机号")
    private String phone;
    @Schema(description = "用户昵称")
    private String nickname;
    @Schema(description = "头像图片URL")
    private String avatar;
    @Schema(description = "性别：0-未知,1-男,2-女")
    private Integer gender;
    @Schema(description = "状态：0-禁用,1-正常")
    private Integer status;
    @Schema(description = "最后登录时间")
    private java.time.LocalDateTime last_login_time;
    @Schema(description = "创建时间")
    private java.time.LocalDateTime created_at;
    @Schema(description = "更新时间")
    private java.time.LocalDateTime updated_at;

}
